Optimal. Leaf size=74 \[ -\frac {3 c^2 \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {3 c^2 \tan (e+f x)}{a f}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {4042, 3872,
3855, 3852, 8} \begin {gather*} \frac {3 c^2 \tan (e+f x)}{a f}-\frac {3 c^2 \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 4042
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx &=\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))}-\frac {(3 c) \int \sec (e+f x) (c-c \sec (e+f x)) \, dx}{a}\\ &=\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))}-\frac {\left (3 c^2\right ) \int \sec (e+f x) \, dx}{a}+\frac {\left (3 c^2\right ) \int \sec ^2(e+f x) \, dx}{a}\\ &=-\frac {3 c^2 \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))}-\frac {\left (3 c^2\right ) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{a f}\\ &=-\frac {3 c^2 \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {3 c^2 \tan (e+f x)}{a f}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(220\) vs. \(2(74)=148\).
time = 1.67, size = 220, normalized size = 2.97 \begin {gather*} \frac {2 c^2 \cos \left (\frac {1}{2} (e+f x)\right ) \sec (e+f x) \sin \left (\frac {1}{2} (e+f x)\right ) \left (4 \csc \left (\frac {1}{2} (e+f x)\right ) \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+\cot \left (\frac {1}{2} (e+f x)\right ) \left (3 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-3 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\frac {\sin (f x)}{\left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}\right )\right )}{a f (1+\sec (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 80, normalized size = 1.08
method | result | size |
derivativedivides | \(\frac {4 c^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f a}\) | \(80\) |
default | \(\frac {4 c^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f a}\) | \(80\) |
risch | \(\frac {2 i c^{2} \left (4 \,{\mathrm e}^{2 i \left (f x +e \right )}+{\mathrm e}^{i \left (f x +e \right )}+5\right )}{f a \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}+\frac {3 c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a f}-\frac {3 c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a f}\) | \(110\) |
norman | \(\frac {\frac {6 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {10 c^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}+\frac {4 c^{2} \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}+\frac {3 c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a f}-\frac {3 c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a f}\) | \(129\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 242 vs.
\(2 (80) = 160\).
time = 0.29, size = 242, normalized size = 3.27 \begin {gather*} -\frac {c^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (f x + e\right )}{{\left (a - \frac {a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} + 2 \, c^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - \frac {c^{2} \sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.82, size = 129, normalized size = 1.74 \begin {gather*} -\frac {3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (5 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left (a f \cos \left (f x + e\right )^{2} + a f \cos \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {c^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {2 \sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 97, normalized size = 1.31 \begin {gather*} -\frac {\frac {3 \, c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac {3 \, c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac {4 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a} + \frac {2 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.64, size = 77, normalized size = 1.04 \begin {gather*} \frac {4\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,f}+\frac {2\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (a-a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}-\frac {6\,c^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________